package org.sky.model;

import javax.persistence.*;
import java.util.Date;

/**
 * Created with IntelliJ IDEA.
 * User: Administrator
 * Date: 12-10-17
 * Time: 上午2:04
 * To change this template use File | Settings | File Templates.
 */

@Entity
public class RoomUsed {

    /**
     * 编号
     */
    private int id;

    /**
     * 使用k房
     */
    private Room room;

    /**
     * K房使用开始时间
     */
    private Date startTime;

    /**
     * K房使用结束时间
     */
    private Date endTime;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 房费
     */
    private double money = 0.0d;

    /**
     * 使用套餐
     * 2:按小时计算
     * 1:包房低消
     * 3:按人数计算
     */
    private Meal meal;

    /**
     * 是否使用
     * 0:未结账
     * 1:已结账
     */
    private int pay;

    /**
     * 预约订单号
     */
    private Booking orderId;

    /**
     * 实际到场人数
     */
    private int singerNum;

    /**
     * 额外费用 （包括酒水、事物）
     */
    private double extraMoney;

    @Id
    @GeneratedValue
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @ManyToOne
    @JoinColumn(name = "roomId", nullable = false)
    public Room getRoom() {
        return room;
    }

    public void setRoom(Room room) {
        this.room = room;
    }

    @Column(nullable = false)
    public Date getStartTime() {
        return startTime;
    }

    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }

    @Column(nullable = false)
    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    @Column(columnDefinition = "double default 0.0")
    public double getMoney() {
        return money;
    }

    public void setMoney(double money) {
        this.money = money;
    }

    @ManyToOne
    @JoinColumn(name = "mealId", nullable = false)
    public Meal getMeal() {
        return meal;
    }

    public void setMeal(Meal meal) {
        this.meal = meal;
    }

    @Column(columnDefinition = "INT default 0")
    public int getPay() {
        return pay;
    }

    public void setPay(int pay) {
        this.pay = pay;
    }

    @OneToOne
    @JoinColumn(name = "orderId", nullable = false)
    public Booking getOrderId() {
        return orderId;
    }

    public void setOrderId(Booking orderId) {
        this.orderId = orderId;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    @Column(columnDefinition = "double default 0.0")
    public double getExtraMoney() {
        return extraMoney;
    }

    public void setExtraMoney(double extraMoney) {
        this.extraMoney = extraMoney;
    }

    public int getSingerNum() {
        return singerNum;
    }

    public void setSingerNum(int singerNum) {
        this.singerNum = singerNum;
    }
}
